import request from './request.ts'

// 获取消息列表分页
export const getMessagPage = (data)=>{
  return request({
    url:`/mgr/message-push/station/inside/notice/page`,
    method:'get',
    params:data
  })
}
// 获取消息列表所有
export const messageAll= (data)=>{
  return request({
    url:`/mgr/message-push/station/inside/notice/list`,
    method:'get',
    params:data
  })
}
  
// 获取消息详情
export const getMessageDetail = (id)=>{
  return request({
    url:`/mgr/message-push//station/inside/notice/${id}/detail`,
    method:'get'
  })
}
  // 标记所有为已读
export const messageAllRead = ()=>{
  return request({
    url:`/mgr/message-push/station/inside/notice/all/read`,
    method:'get'
  })
}
// 消息下拉
export function messageInsideSelect(){
  return request({
    url:`/mgr/document/message/inside/select`,
    method:'get'
  })
}
export function messageEmailSelect(){
  return request({
    url:`/mgr/document/message/email/select`,
    method:'get'
  })
}
export function messageSmsSelect(){
  return request({
    url:`/mgr/document/message/sms/select`,
    method:'get'
  })
}
export function messageWxSelect(){
  return request({
    url:`/mgr/document/message/wechat/select`,
    method:'get'
  })
}
// 文库消息配置
export function messageGet(data){
  return request({
    url:`/mgr/document/message/get`,
    method:'get',
    params:data
  })
}

// 获取消息发送历史
export const messageSendLog = (data)=>{
  return request({
    url:`/mgr/message-push/message/push/his/page`,
    method:"get",
    params:data
  })
}

// 重新发送
export const messageReSend = (data)=>{
  return request({
    // /mgr/message-push/message/push/his/resend
    url:`/mgr/message-push/message/push/his/${data.id}/resend`,
    method:"get",
    params:data
  })
}

// 站内分页
export function messageInsidePage(data){
  return request({
    url:`/mgr/document/message/inside/page`,
    method:'get',
    params:data
  })
}
// 站内新增或修改
export function messageInsideUpdate(data){
  return  request({
    url:`/mgr/document/message/inside/update`,
    method:"post",
    data:data
  })
}
// 站内删除
export function messageInsideDel(id){
  return request({
    url:`/mgr/document/message/inside/del/${id}`,
    method:'post'
  })
}

// 短信分页
export function messageSmsPage(data){
  return request({
    url:`/mgr/document/message/sms/page`,
    method:'get',
    params:data
  })
}
// 短信新增或修改
export function messageSmsAdd(data){
  return request({
    url:`/mgr/document/message/sms/update`,
    method:'post',
    data
  })
}
// 短信删除
export function messageSmsDel(id){
  return request({
    url:`/mgr/document/message/sms/del/${id}`,
    method:'post'
  })
}

// 邮件分页
export function messageEmailPage(data){
  return request({
    url:`/mgr/document/message/email/page`,
    method:'get',
    params:data
  })
}
// 邮件新增或修改
export function messageEmailAdd(data){
  return request({
    url:`/mgr/document/message/email/update`,
    method:'post',
    data
  })
}
// 邮件删除
export function messageEmailDel(id){
  return request({
    url:`/mgr/document/message/email/del/${id}`,
    method:'post'
  })
}

// 微信消息
export function messageWxPage(data){
  return request({
    url:`/mgr/document/message/wechat/page`,
    method:'get',
    params:data
  })
}
export function messageWxById(id){
  return request({
    url:`/mgr/document/message/wechat/${id}`,
    method:'get',
  })
}
export function messageWxupdate(data){
  return request({
    url:`/mgr/document/message/wechat/update`,
    method:'post',
    data:data
  })
}
export function messageWxDel(id){
  return request({
    url:`/mgr/document/message/wechat/del/${id}`,
    method:'post'
  })
}

// 获取公众号消息模板
export const getWxmpTemplateList = ()=>{
  return request({
    url:`/mgr/jvs-auth/tenant/admin/base/WECHAT_MP/message`,
    method:'get'
  })
}

// 获取短信消息模板
export const getSmsTemplateList = ()=>{
  return request({
    url:`/mgr/jvs-auth/tenant/admin/base/SMS/message?size=500&current=1`,
    method:'get'
  })
}

// 获取所有消息变量
export function messageVarSelect(){
  return request({
    url:`/mgr/document/message/variable/select`,
    method:'get'
  })
}

// 消息变量查询
export function messageGetVar(id){
  return request({
    url:`/mgr/document/message/variable/bin/ding/select/${id}`,
    method:'get'
  })
}

export function messageSave(data,id){
  return request({
    url:`/mgr/document/message/update/batch/${id}`,
    method:'post',
    data
  })
}

// 是否推送消息
export function messageIsPush(data){
  return request({
    url:`/mgr/document/dcLibrary/notify/read/setting`,
    method:"put",
    data
  })
}